package com.wm.exam.utils;

import java.util.Random;

/**
 * 验证码工具
 */
public class VerifyCodeUtil {
    /**
     * 生成验证码6位数字
     */
    public static String createVerifyCode() {
        String sources = "0123456789";
        Random rand = new Random();
        StringBuffer flag = new StringBuffer();
        for (int j = 0; j < 6; j++)
        {
            flag.append(sources.charAt(rand.nextInt(9)) + "");
        }
        return flag.toString();
    }
}
